﻿using System;
using System.Collections.Generic;
using System.Linq;
using PHPDecoder;
using System.IO;

namespace LibTester
{
    class Program
    {
        static void Main(string[] args)
        {
            myDecoder d = new myDecoder(@"E:\usr\WebDir\phpMyAdmin\index.php");
            //myDecoder d = new myDecoder(@"TestFiles\test.php");
            DateTime dd = DateTime.Now;
            AnalyseResult res = d.Decode();
            AnalyseResult.Save("output.dat", res);
            res = null;
            AnalyseResult.Load("output.dat", ref res);
            Setting.LoadDefaultSetting();
            Setting.ApplyFilter(ref res);
            Setting.Save();
            Setting.Load();
            List<FunctionNode> ll = res.getAllFunctionsSortedByCall();
            List<VariableNode> ll2 = res.getAllVarsSortedByRead();
            List<VariableNode> ll3 = res.getAllVarsSortedByWrite();
            List<VariableNode> ll4 = res.getAllVarsSortedByChange();
            //ll.Add();
            DateTime dd2 = DateTime.Now;
            Console.WriteLine(dd2.Second * 1000 + dd2.Millisecond - dd.Second * 1000 + dd.Millisecond);
            //Console.WriteLine(string.Format());
        }
    }
}
